package com.dirven.game;

public class Level {

	private static int level = 1;
	
	/**
	 * Set the current level
	 * 
	 * @param lvl
	 */
	public void setupLevel(int lvl) {
		level = lvl;
	}
	
	public static void incrementLevel() {
		level++;
	}
	
	/**
	 * Gets the current level.
	 * 
	 * @return
	 */
	public static int getCurrentLevel() {
		return level;
	}
	
	/**
	 * Gets the time the player must survive in the station. In milliseconds.
	 * 
	 * @return
	 */
	public static long getSurvivalTimeInStation() {
		//TODO: make formula that works with all levels.
		
		long timeInSeconds = 0;
		
		// For levels 1 to 3, survive for 30 seconds
		if(level >=1 && level <= 2) {
			timeInSeconds = 10;
		} else if(level >= 3 && level <= 5) {
			timeInSeconds = 10 + 5;
		} else {
			timeInSeconds = 10 + level;
		}
		
		// TODO: modify the time based on the game difficulty
		return timeInSeconds * 1000;
	}
	
	/**
	 * Gets the time the player must survive in the tunnel. In milliseconds.
	 * 
	 * @return
	 */
	public static long getSurvivalTimeInTunnel() {
		// TODO: modify the time based on the game difficulty
		return getSurvivalTimeInStation()/2;
	}
}
